package bean;

import java.sql.Connection;
import java.sql.DriverManager;

/*
 *  
 */
public class MyOracle {	// 공통모듈
	
	Connection conn;	// 커넥션을 만들어서 반환하기위해서

	public MyOracle() {
		String driver = "oracle.jdbc.driver.OracleDriver";
		String url = "jdbc:oracle:thin:@127.0.0.1:1521:xe";
		String user = "hr";
		String password = "hr";
		
		try {
			Class.forName(driver);
			System.out.println("드라이버가 로딩됨.");
			
			conn = DriverManager.getConnection(url, user, password);
			System.out.println("커넥션 성공");
		} catch (Exception e) {
			// TODO: handle exception
		}
		
		// TODO Auto-generated constructor stub
	}

	public static void main(String[] args) {
		MyOracle mo = new MyOracle();
		// TODO Auto-generated method stub

	}

	public Connection getConn() {
		
		return conn;
	}
}
